//	@file Version: 1.0
//	@file Name: boxCreation.sqf
//	@file Author: [404] Costlyy
//	@file Created: 19/12/2012 23:19
//	@file Args: [string (selected weapon crate), array (position)]

// This file is to address the serious imbalance caused by the default load-out of all weapon crates.

if(!X_Server) exitWith {};

private ["_selectedBox", "_selectedBoxPos", "_finishedBox", "_currBox"];

_selectedBox = _this select 0;
_selectedBoxPos = _this select 1;

switch(_selectedBox) do {
	case "basicUS": { // Basic US 1 is mainly M16's and standard US Army weaponry
    	_currBox = createVehicle ["USBasicWeaponsBox", _selectedBoxPos,[], 30, "NONE"];
        
        // Clear prexisting weapons first
        clearMagazineCargoGlobal _currBox;
		clearWeaponCargoGlobal _currBox;
        
        // Add new weapons before ammunition
        _currBox addWeaponCargoGlobal ["I44_Grenade_PIATMk3",4];
		_currBox addWeaponCargoGlobal ["I44_StG44",4];
		_currBox addWeaponCargoGlobal ["I44_MP43",4];
		_currBox addWeaponCargoGlobal ["I44_FG42I_bipod",4];	
        
        // Add ammunition
        _currBox addMagazineCargoGlobal ["I44_20rd_792x57_Mix_FG42",20];
        _currBox addMagazineCargoGlobal ["I44_20rd_792x57_AP_FG42",10];
        _currBox addMagazineCargoGlobal ["I44_20rd_762x63_Mix_M1918",20];
        _currBox addMagazineCargoGlobal ["I44_20rd_762x63_AP_M1918",10];
        _currBox addMagazineCargoGlobal ["I44_30rd_792x33_Ball_MP43",30];  
    };
    case "basicUS2": { // Basic US 2 is a few M4's and some combat shotguns
    	_currBox = createVehicle ["USBasicWeaponsBox", _selectedBoxPos,[], 30, "NONE"];
        
        // Clear prexisting weapons first
        clearMagazineCargoGlobal _currBox;
		clearWeaponCargoGlobal _currBox;
        
        // Add new weapons before ammunition
        _currBox addWeaponCargoGlobal ["I44_G43",4];
		_currBox addWeaponCargoGlobal ["I44_K98k",4];
		_currBox addWeaponCargoGlobal ["I44_LeeEnfield",4];
		_currBox addWeaponCargoGlobal ["44_DeLisleCarbine",4];	
        
        // Add ammunition
        _currBox addMagazineCargoGlobal ["I44_7rd_1143x23_Ball_DeLisle",40];
        _currBox addMagazineCargoGlobal ["I44_5rd_792x57_Mix_K98",15];
        _currBox addMagazineCargoGlobal ["I44_5rd_792x57_AP_K98",15];
        _currBox addMagazineCargoGlobal ["I44_10rd_792x57_Mix_G43",15];
        _currBox addMagazineCargoGlobal ["I44_10rd_792x57_AP_G43",15];
        _currBox addMagazineCargoGlobal ["I44_HandGrenade_No82",5];
        _currBox addMagazineCargoGlobal ["I44_SmokeGrenade_ANM8",5];
    };
    case "basicRU": { // Basic RU 1 is mainly AK's and better pistols, footsoldier weapons.
    	_currBox = createVehicle ["RUBasicWeaponsBox", _selectedBoxPos,[], 30, "NONE"];
        
        // Clear prexisting weapons first
        clearMagazineCargoGlobal _currBox;
		clearWeaponCargoGlobal _currBox;
        
        // Add new weapons before ammunition
        _currBox addWeaponCargoGlobal ["I44_M1A1Thompson",4];
		_currBox addWeaponCargoGlobal ["I44_M3Greasegun",4];
		_currBox addWeaponCargoGlobal ["I44_MP40",4];
		_currBox addWeaponCargoGlobal ["I44_StenMk5",4];	
        
        // Add ammunition
        _currBox addMagazineCargoGlobal ["I44_32rd_9x19_Ball_Sten",40];
        _currBox addMagazineCargoGlobal ["I44_32rd_9x19_Ball_MP40",40];
        _currBox addMagazineCargoGlobal ["I44_30rd_1143x23_Mix_M3Greasegun",40];
        _currBox addMagazineCargoGlobal ["I44_30rd_1143x23_Tracer_M1A1Thompson",40];
        _currBox addMagazineCargoGlobal ["I44_SmokeGrenade_NbHgr39",10];
    };
    case "basicRU2": { // More Ak's and some shotguns and other crap
    	_currBox = createVehicle ["RUBasicWeaponsBox", _selectedBoxPos,[], 30, "NONE"];
        
        // Clear prexisting weapons first
        clearMagazineCargoGlobal _currBox;
		clearWeaponCargoGlobal _currBox;
        
        // Add new weapons before ammunition
        _currBox addWeaponCargoGlobal ["I44_M1A1Thompson",4];
		_currBox addWeaponCargoGlobal ["I44_M3Greasegun",4];
		_currBox addWeaponCargoGlobal ["I44_MP40",4];
		_currBox addWeaponCargoGlobal ["I44_StenMk5",4];	
        
        // Add ammunition
        _currBox addMagazineCargoGlobal ["I44_32rd_9x19_Ball_Sten",40];
        _currBox addMagazineCargoGlobal ["I44_32rd_9x19_Ball_MP40",40];
        _currBox addMagazineCargoGlobal ["I44_30rd_1143x23_Mix_M3Greasegun",40];
        _currBox addMagazineCargoGlobal ["I44_30rd_1143x23_Tracer_M1A1Thompson",40];
        _currBox addMagazineCargoGlobal ["I44_HandGrenade_No82",10];
    };
    case "basicGER": { // G36's everywhere...
    	_currBox = createVehicle ["GERBasicWeapons_EP1", _selectedBoxPos,[], 30, "NONE"];
        
        // Clear prexisting weapons first
        clearMagazineCargoGlobal _currBox;
		clearWeaponCargoGlobal _currBox;
        
        // Add new weapons before ammunition
        _currBox addWeaponCargoGlobal ["I44_M1A1Thompson",3];
		_currBox addWeaponCargoGlobal ["I44_M3Greasegun",3];
		_currBox addWeaponCargoGlobal ["I44_MP40",3];
        _currBox addWeaponCargoGlobal ["I44_StenMk2",3];
		_currBox addWeaponCargoGlobal [" I44_FG42I",3];	 
        _currBox addWeaponCargoGlobal ["I44_FG42II",3];
        _currBox addWeaponCargoGlobal ["I44_PzFaust100",4];
        
        // Add ammunition
        _currBox addMagazineCargoGlobal ["I44_20rd_792x57_Tracer_FG42",20];
        _currBox addMagazineCargoGlobal ["I44_30rd_1143x23_Tracer_M1A1Thompson",40];
        _currBox addMagazineCargoGlobal ["I44_32rd_9x19_Ball_Sten",40];
        _currBox addMagazineCargoGlobal ["I44_32rd_9x19_Ball_MP40",40];
        _currBox addMagazineCargoGlobal ["I44_20rd_792x57_AP_FG4",20];
        _currBox addMagazineCargoGlobal ["I44_32rd_9x19_Ball_MP40",40];
        _currBox addMagazineCargoGlobal ["I44_Rocket_149mm_PzF_100",4];
    };
    case "basicPMC": { // Most OP weapons in the game, this will be a saught after crate.
    	_currBox = createVehicle ["Ammobox_PMC", _selectedBoxPos,[], 30, "NONE"];
        
        // Clear prexisting weapons first
        clearMagazineCargoGlobal _currBox;
		clearWeaponCargoGlobal _currBox;
        
        // Add new weapons before ammunition
        _currBox addWeaponCargoGlobal ["I44_G43Zf4",2];
		_currBox addWeaponCargoGlobal ["I44_K98k_GGrGer",2];
		_currBox addWeaponCargoGlobal ["I44_LeeEnfieldNo4Mk1_T",2];
		_currBox addWeaponCargoGlobal ["I44_M1903A3_M1",2];	
        
        // Add ammunition
        _currBox addMagazineCargoGlobal ["I44_5rd_762x63_Mix_M1903",20];
        _currBox addMagazineCargoGlobal ["I44_10rd_77x56R_Ball_LeeEnfield",20];
        _currBox addMagazineCargoGlobal ["I44_5rd_792x57_Mix_K98",20];
        _currBox addMagazineCargoGlobal ["I44_10rd_792x57_Mix_G43",20];
        _currBox addMagazineCargoGlobal ["I44_HandGrenade_Mk2",10];
        _currBox addMagazineCargoGlobal ["I44_SmokeGrenade_M18Red",10];
    };
    case "basicSpecial": { // Silent weapons
    	_currBox = createVehicle ["SpecialWeaponsBox", _selectedBoxPos,[], 30, "NONE"];
        
        // Clear prexisting weapons first
        clearMagazineCargoGlobal _currBox;
		clearWeaponCargoGlobal _currBox;
        
        // Add new weapons before ammunition
        _currBox addWeaponCargoGlobal ["I44_Rocket_60mm_M6A1_M1A1Bazooka",2];
		_currBox addWeaponCargoGlobal ["I44_Grenade_PIATMk3",2];
        _currBox addWeaponCargoGlobal ["I44_PzFaust100",4];
		_currBox addWeaponCargoGlobal ["I44_RPzB54",4];	
        
        // Add ammunition
        _currBox addMagazineCargoGlobal ["I44_Rocket_60mm_M6A1_M1A1Bazooka",5];
        _currBox addMagazineCargoGlobal ["I44_Rocket_149mm_PzF_100",5];
        _currBox addMagazineCargoGlobal ["I44_Rocket_88mm_RPzBGr4322_RPzB54",5];
        _currBox addMagazineCargoGlobal ["I44_Grenade_PIATMk3",5];
    };
    case "basicSpecial2": { // BAF weapons
    	_currBox = createVehicle ["SpecialWeaponsBox", _selectedBoxPos,[], 30, "NONE"];
        
        // Clear prexisting weapons first
        clearMagazineCargoGlobal _currBox;
		clearWeaponCargoGlobal _currBox;
        
        // Add new weapons before ammunition
        _currBox addWeaponCargoGlobal ["I44_BrenMk1",2];
		_currBox addWeaponCargoGlobal ["I44_M1919A4",2];
		_currBox addWeaponCargoGlobal ["I44_MG34",2];
        _currBox addWeaponCargoGlobal ["I44_MG42",2];
        
        // Add ammunition
        _currBox addMagazineCargoGlobal ["I44_30rd_77x56R_Mix_Bren",15];
        _currBox addMagazineCargoGlobal ["I44_50rd_762x63_Tracer_M1919",10];
        _currBox addMagazineCargoGlobal ["I44_50rd_762x63_AP_M1919",10];
        _currBox addMagazineCargoGlobal ["I44_50rd_792x57_Mix_MG34",15];
        _currBox addMagazineCargoGlobal ["I44_50rd_792x57_Mix_MG42",10];
        _currBox addMagazineCargoGlobal ["I44_50rd_792x57_AP_MG42",10];
    };
    case "basicSpecial3": { // Misc weapons, mostly shit
    	_currBox = createVehicle ["TKBasicWeapons_EP1", _selectedBoxPos,[], 30, "NONE"];
        
        // Clear prexisting weapons first
        clearMagazineCargoGlobal _currBox;
		clearWeaponCargoGlobal _currBox;
        
        // Add new weapons before ammunition
        _currBox addWeaponCargoGlobal ["I44_M1A1Thompson",3];
		_currBox addWeaponCargoGlobal ["I44_M3Greasegun",3];
		_currBox addWeaponCargoGlobal ["I44_MP40",3];
        _currBox addWeaponCargoGlobal ["I44_StenMk2",3];
		_currBox addWeaponCargoGlobal [" I44_FG42I",3];	 
        _currBox addWeaponCargoGlobal ["I44_FG42II",3];
        _currBox addWeaponCargoGlobal ["I44_PzFaust100",4];
        
        // Add ammunition
        _currBox addMagazineCargoGlobal ["I44_20rd_792x57_Tracer_FG42",20];
        _currBox addMagazineCargoGlobal ["I44_30rd_1143x23_Tracer_M1A1Thompson",40];
        _currBox addMagazineCargoGlobal ["I44_32rd_9x19_Ball_Sten",40];
        _currBox addMagazineCargoGlobal ["I44_32rd_9x19_Ball_MP40",40];
        _currBox addMagazineCargoGlobal ["I44_20rd_792x57_AP_FG4",20];
        _currBox addMagazineCargoGlobal ["I44_32rd_9x19_Ball_MP40",40];
        _currBox addMagazineCargoGlobal ["I44_Rocket_149mm_PzF_100",4];
    };
    case "mission_Mid_BAF": { // Broad selection mid-high tier weapons 
    	_currBox = createVehicle ["BAF_BasicWeapons", _selectedBoxPos,[], 30, "NONE"];
        
        // Clear prexisting weapons first
        clearMagazineCargoGlobal _currBox;
		clearWeaponCargoGlobal _currBox;
        
        // Add new weapons before ammunition
        _currBox addWeaponCargoGlobal ["I44_G43",2];
        _currBox addWeaponCargoGlobal ["I44_G43Zf4",1];
		_currBox addWeaponCargoGlobal ["I44_K43",2];			
		_currBox addWeaponCargoGlobal ["I44_K98k",2];
        _currBox addWeaponCargoGlobal [" I44_K98k_GGrGer",1];
		_currBox addWeaponCargoGlobal ["I44_K98kZf42",1];
        _currBox addWeaponCargoGlobal [" I44_LeeEnfield",2];
        _currBox addWeaponCargoGlobal ["I44_LeeEnfieldNo4Mk1",1];		
		_currBox addWeaponCargoGlobal ["I44_LeeEnfieldNo4Mk1_T",1];
		_currBox addWeaponCargoGlobal ["I44_M1903A3_M1",1];	 
        _currBox addWeaponCargoGlobal ["I44_M37Ithaca",2];
        
        // Add ammunition
        _currBox addMagazineCargoGlobal ["I44_10rd_792x57_Tracer_G43",5];
        _currBox addMagazineCargoGlobal ["I44_10rd_792x57_Mix_G43",5];
        _currBox addMagazineCargoGlobal ["I44_10rd_792x57_Ball_G43",5];
		_currBox addMagazineCargoGlobal ["I44_5rd_792x57_Tracer_K98",10];
        _currBox addMagazineCargoGlobal ["I44_10rd_77x56R_Ball_LeeEnfield",20];
        _currBox addMagazineCargoGlobal ["I44_5rd_792x57_AP_K98",10];
        _currBox addMagazineCargoGlobal ["I44_10rd_792x57_AP_G43",5];
        _currBox addMagazineCargoGlobal ["I44_5rd_762x63_AP_M1903",10];
        _currBox addMagazineCargoGlobal ["I44_5rd_762x63_Tracer_M1903",10];
		_currBox addMagazineCargoGlobal ["I44_4xM19_12ga_00Buckshot_M37",20];
        _currBox addMagazineCargoGlobal ["I44_HandGrenade_No82",5];
        _currBox addMagazineCargoGlobal ["I44_HandGrenade_Mk2",5];
        _currBox addMagazineCargoGlobal ["I44_HandGrenade_No36M",5];
		_currBox addMagazineCargoGlobal ["I44_HandGrenade_StiHgr24x7",5]; 		
    };
};